Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add unit test for GlobalRequestLimiter #1525

Closed
wants to merge 1 commit into from

Conversation

yunfeiyanggzq
Copy link
Contributor

@yunfeiyanggzq yunfeiyanggzq commented Jun 5, 2020

Signed-off-by: yunfeiyanggzq yunfeiyang@buaa.edu.cn

Special notes for reviews

I am an asoc participant. I will be mainly responsible for the cluster flow control. I will supplement the missing unit tests while reading the relative code.Thanks for your help and review

@codecov-commenter
Copy link

codecov-commenter commented Jun 5, 2020

Codecov Report

Merging #1525 into master will increase coverage by 0.44%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1525      +/-   ##
============================================
+ Coverage     43.99%   44.44%   +0.44%     
- Complexity     1727     1757      +30     
============================================
  Files           376      376              
  Lines         10682    10696      +14     
  Branches       1425     1427       +2     
============================================
+ Hits           4700     4754      +54     
+ Misses         5412     5364      -48     
- Partials        570      578       +8     
Impacted Files Coverage Δ Complexity Δ
...nel/adapter/dubbo/SentinelDubboProviderFilter.java 62.06% <0.00%> (-21.27%) 4.00% <0.00%> (+2.00%) ⬇️
...csp/sentinel/adapter/dubbo/config/DubboConfig.java 66.66% <0.00%> (-13.34%) 8.00% <0.00%> (-1.00%)
...nel/adapter/dubbo/SentinelDubboConsumerFilter.java 91.66% <0.00%> (-3.58%) 11.00% <0.00%> (+8.00%) ⬇️
...p/sentinel/datasource/consul/ConsulDataSource.java 69.56% <0.00%> (-2.90%) 7.00% <0.00%> (ø%)
...alibaba/csp/sentinel/adapter/dubbo/DubboUtils.java 96.15% <0.00%> (+0.32%) 11.00% <0.00%> (+2.00%)
...aba/csp/sentinel/adapter/servlet/CommonFilter.java 90.24% <0.00%> (+2.43%) 12.00% <0.00%> (+1.00%)
...tinel/slots/block/flow/param/ParamFlowChecker.java 56.29% <0.00%> (+2.64%) 30.00% <0.00%> (+1.00%)
...ster/server/config/ClusterServerConfigManager.java 19.33% <0.00%> (+2.76%) 9.00% <0.00%> (+2.00%)
...entinel/adapter/dubbo/BaseSentinelDubboFilter.java 100.00% <0.00%> (+22.22%) 1.00% <0.00%> (-4.00%) ⬆️
...ter/flow/statistic/limit/GlobalRequestLimiter.java 53.57% <0.00%> (+53.57%) 8.00% <0.00%> (+8.00%)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bd29e04...f2dd955. Read the comment docs.

Signed-off-by: yunfeiyanggzq <yunfeiyang@buaa.edu.cn>
@sczyh30 sczyh30 added the area/test Issue or PR related to test cases label Jun 5, 2020
@Test
public void testChangeMaxAllowedQps(){
ClusterServerConfigManager.setMaxAllowedQps(4000);
GlobalRequestLimiter.initIfAbsent("foo");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may need to reset the global config or storage in @Before/@After stage.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done,In order to simplify the work, I have add these change to #1529, this pr will be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/test Issue or PR related to test cases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants